/***********************************************************************
 * Module:  UseNatureController.java
 * Author:  Administrator
 * Purpose: Defines the Class UseNatureController
 ***********************************************************************/

package ishitong.vehicleManagement.controller;

import ishitong.common.model.SysCode;
import ishitong.dataDictionary.controller.SysCodeType;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/** @pdOid f562d4e1-4a48-412a-86b2-0e2d3f07c37e */
@Controller
public class UseNatureController extends ishitong.common.controller.ActionController {
   /** @pdOid 56be3cf6-5f84-4c9a-a18c-7d2d3a8b63bc */
   private static final String UNT_SLT_DLG = "vehicleManagement/useNature/useNatureSelectDialog";
   /** @pdOid 8eaba292-f01d-4f01-9751-0adbd4cd655e */
   private static final String UNT_SLT_LST = "vehicleManagement/useNature/useNatureSelectList";
   
   /** @param request
    * @pdOid 7099782c-02d6-4fc5-adcd-f3872fa71f78 */
   @RequestMapping(value = "/ajaxShowUseNatureSelectDialog.do")
   public ModelAndView handleAjaxShowUseNatureSelectDialog(HttpServletRequest request) {
   	return new ModelAndView(UNT_SLT_DLG);
   }
   
   /** @param request 
    * @param sysCode
    * @pdOid 8c2de9c2-b64b-429c-bcbd-1e76f8f756d4 */
   @RequestMapping(value = "/ajaxFindUseNatureSelectList.do",method = RequestMethod.POST)
   public ModelAndView handleAjaxFindUseNatureSelectList(HttpServletRequest request, SysCode sysCode) {
   	try {
   		Map<String, Object> model = new HashMap<>();
   		List<SysCode> listUseNature = spiSysCodeService.getSysCodeListByTypeCodeAndCondition(SysCodeType.USE_NATURE,sysCode);
   		model.put("listUseNature", listUseNature);
   		return new ModelAndView(UNT_SLT_LST, model);
   	} catch (Exception e) {
   		e.printStackTrace();
   	}
   	return null;
   }

}